  <!-- 关于我们 -->
{include file="common:header" /}
<link rel="stylesheet" href="/assets/plugins/bower_components/bootstrap-datetimepicker/bootstrap-datetimepicker.css">
{include file="common:side" /}
    <div id="page-wrapper">
      <!--*************************** content部分开始 ******************-->
      <div class="container-fluid" id="m_main">
        <div class="row m-t-20">
          <div class="col-sm-12">
            <div class="white-box">
              <h2 class="box-title">关于我们</h2>
            </div>
            <div class="white-box">
              <div class="row m-l-5 m-b-20">
                <!-- <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> -->
                <textarea id="editor" v-model="content" style="width:100%;height:500px;"></textarea>
              </div>
              <div class="form-actions m-b-10">
                <button type="submit" class="btn btn-info m-t-10" @click="submitEvent">添加</button>
              </div>
            </div>
          </div>
        </div>
        <!-- /.row -->
      </div>
      <!--*************************** content部分结束 ******************-->

      <!-- <footer class="footer text-center"> 2017 &copy; Ample Admin brought to you by themedesigner.in </footer> -->
    </div>
  </div>
  {include file="common:js" /}
  <script type="text/javascript" src="/web/js/search_list.js"></script>
  <script type="text/javascript" charset="utf-8" src="/web/uedit/ueditor.config.js"></script>
  <script type="text/javascript" charset="utf-8" src="/web/uedit/ueditor.all.min.js"> </script>
  {include file="common:footer" /}
  {include file="component:pagination" /}
  {include file="component:confirm" /}

  <script type="text/javascript">
    var vm = new Vue({
      el: '#m_main',
      data() {
        return {
          id: "",
          content: "",
        }
      },
      mounted() {
        this.getInfo()
      },
      methods: {
        getInfo() {
          axios.post('/dashboard/index/get_about_us', {},{headers: {'X-Requested-with':'XMLHttpRequest'}}).then(res => {
            if(res.data.ErrorCode == 1){
              //请求成功
              this.content = res.data.Data.content;
              var ue = UE.getEditor('editor');
            }else{
              alert(res.data.Msg)
            }
          }).catch(err => {
            console.log(err);
          })
        },
        submitEvent() {
          var that = this;
          var ue = UE.getEditor('editor');
          that.content = ue.getContent()
          axios.post('/dashboard/index/about_us', {content: that.content},{headers: {'X-Requested-with':'XMLHttpRequest'}}).then(res => {
            // console.log(res);
            if(res.data.ErrorCode == 1){
              //请求成功
              that.getInfo()
            }else{
              alert(res.data.ErrorMsg)
            }
          }).catch(err => {
            console.log(err);
          })
        }
      }
    })
  </script>
</body>

</html>
